﻿@page
@model AspnetRun.Web.Pages.Product.CreateModel

@{
    ViewData["Title"] = "Create";
}

<h1>Create</h1>

<h4>Product</h4>
<hr />
<div class="row">
    <div class="col-md-4">
        <form method="post">
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            <div class="form-group">
                <label asp-for="Product.ProductName" class="control-label"></label>
                <input asp-for="Product.ProductName" class="form-control" />
                <span asp-validation-for="Product.ProductName" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Product.QuantityPerUnit" class="control-label"></label>
                <input asp-for="Product.QuantityPerUnit" class="form-control" />
                <span asp-validation-for="Product.QuantityPerUnit" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Product.UnitPrice" class="control-label"></label>
                <input asp-for="Product.UnitPrice" class="form-control" />
                <span asp-validation-for="Product.UnitPrice" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Product.UnitsInStock" class="control-label"></label>
                <input asp-for="Product.UnitsInStock" class="form-control" />
                <span asp-validation-for="Product.UnitsInStock" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Product.UnitsOnOrder" class="control-label"></label>
                <input asp-for="Product.UnitsOnOrder" class="form-control" />
                <span asp-validation-for="Product.UnitsOnOrder" class="text-danger"></span>
            </div>
            <div class="form-group">
                <label asp-for="Product.ReorderLevel" class="control-label"></label>
                <input asp-for="Product.ReorderLevel" class="form-control" />
                <span asp-validation-for="Product.ReorderLevel" class="text-danger"></span>
            </div>
            <div class="form-group form-check">
                <label class="form-check-label">
                    <input class="form-check-input" asp-for="Product.Discontinued" /> @Html.DisplayNameFor(model => model.Product.Discontinued))
                </label>
            </div>
            <div class="form-group">
                <label asp-for="Product.CategoryId" class="control-label"></label>
                <select asp-for="Product.CategoryId" class ="form-control" asp-items="ViewBag.CategoryId"></select>
            </div>
            <div class="form-group">
                <input type="submit" value="Create" class="btn btn-primary" />
            </div>
        </form>
    </div>
</div>

<div>
    <a asp-page="Index">Back to List</a>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
